import React, { useState } from "react";
import {Button} from 'antd-mobile'
import City from "../../components/City";
const Home =()=>{
    const [city,setCity]=useState('')
    const [flag,setFlag]=useState(false)
    const getCity=()=>{
        setCity('北京')
    }
    return (
        <div>
           <Button onClick={getCity}>
            点击地图获取当前位置:
           </Button>
           <h1 onClick={()=>setFlag(true)}>{city}</h1>



           <div style={{display:'flex',justifyContent:'space-between',marginTop:'20px'}}>
              <dl>
                <dt onClick={()=>setFlag(true)}>北京</dt>
                  <dd>出发城市</dd>

              </dl>
                   <span>===&gt;</span>
               <dl>
                <dt>三亚</dt>
                  <dd>到达城市</dd>

              </dl>
           </div>

           <div>
            {
                flag && (
                 <City></City>
                )
            }
           
           </div>
        </div>
    )
}
export default Home